home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
prog
/
spx10.zip
/
SPX_DOC.ZIP
/
SPX_IMG.DOC
< prev
next >
Wrap
Text File
|
1993-05-10
|
4KB
|
104 lines
{ SPX Library Version 1.0 Copyright 1993 Scott D. Ramsay }
SPX_IMG is the image handling unit. It allows loading and saving
of picture files. It supports loading of 320x200x256 PCX files and
my own custom compressed format. PTR files are a quick and dirty RLE
picture format. It does not save the palette data in the file so use
the loadcolors/savecolors procedures to use it's palette.
───────────────────────────────────────────────────────────────────────────
type
VidHdrType = record
position,count : word;
end;
Header type for .PTR format
───────────────────────────────────────────────────────────────────────────
var
rgb256 : RGBlist; { palette of last loaded PCX file }
───────────────────────────────────────────────────────────────────────────
function loadpcx(pfilename:string):integer;
Loads a 320x200x256 color PCX file to the active page. The palette of
the loaded pcx file will be copied to the variable RGB256.
Returns the IORESULT value
PFILENAME: DOS file name of the pcx file to load
NOTE: This function is very fast. However as a cost it will only
load 320x200x256 pcx files. Use loadspcx to load pcx files that
are smaller than 320x200.
───────────────────────────────────────────────────────────────────────────
function loadspcx(fname:string;x,y:integer):boolean;
Loads a 256 PCX file to the active page. The palette of the loaded
pcx file will be copied to the variable RGB256.
Returns the IORESULT value
FNAME: DOS file name of the pcx file to load
X,Y: Row,Column position to place the top-left of the pcx file
NOTE: This function is slower than the loadpcx function. It can load
256 color pcx files of any resolution. Large pcx files will be clipped.
───────────────────────────────────────────────────────────────────────────
procedure filepcx(var pcxfile:file;size:longint);
Loads a PCX file from an open file to the active page. The palette
of the loaded pcx file will be copied to the variable RGB256.
PCXFILE: File to read the pcx data;
SIZE: Size of the PCX data in the file
───────────────────────────────────────────────────────────────────────────
procedure drawpcx(var p;size:word);
Displays a 320x200x256 PCX file currently in memory.
P: Buffer where the pcx data is located;
SIZE: Size of the PCX data in memory
───────────────────────────────────────────────────────────────────────────
procedure drawspcx(var start;size:longint;x,y:integer);
Displays a 256 color PCX file currently in memory.
START: Buffer where the pcx data is located;
SIZE: Size of the PCX data in memory
X,Y: Row,Column position to place the top-left of the pcx file
This function will load any size pcx file. Large files will be clipped.
───────────────────────────────────────────────────────────────────────────
function LoadPTR(fn:string;merge:boolean):integer;
Loads a .PTR file to the active page.
FN: DOS file name of the ptr file to load;
MERGE: Set to TRUE to overlay the PTR file over the
active page
Returns the IORESULT value
───────────────────────────────────────────────────────────────────────────
procedure DrawPtr(var p;merge:boolean;sz:longint);
Displays a PTR file currently in memory.
P: Buffer where the ptr data is located;
MERGE: Set to TRUE to overlay the PTR file over the
active page
───────────────────────────────────────────────────────────────────────────
function SavePTR(fn:string):integer;
Save the active page as a PTR file.
FN: DOS file name of the ptr file to save
───────────────────────────────────────────────────────────────────────────